<?php
namespace Beerus\Modules\DesignerCompetition2022\Controllers;

use App\Http\Controllers\Controller;
use Doraemon\model\ReDesignerCompetition\Audit\DcAuditFinalResultHelper;
use Doraemon\model\ReDesignerCompetition\Audit\DcAuditFinalWorkHelper;
use Doraemon\model\ReDesignerCompetition\Audit\DcAuditFirstResultHelper;
use Doraemon\model\ReDesignerCompetition\Audit\DcAuditFirstWorkHelper;
use Doraemon\pockets\constInterface\Designer\DesignerCompetition2022;

class AuditBaseController extends Controller implements DesignerCompetition2022 {
    public $oAuditWork = null;
    public $oAuditResult = null;
    public $iAuditStep = 1; // 评审阶段，1=初审，2=终审

    public function __construct() {
        parent::__construct();
        switch ($this->iAuditStep) {
            case self::AUDIT_STEP_FIRST:
                $this->oAuditWork = DcAuditFirstWorkHelper::getInstance();
                $this->oAuditResult = DcAuditFirstResultHelper::getInstance();
                break;
            case self::AUDIT_STEP_FINAL:
                $this->oAuditWork = DcAuditFinalWorkHelper::getInstance();
                $this->oAuditResult = DcAuditFinalResultHelper::getInstance();
                break;
            default:
                throw new \Exception('评审参数有误～');
        }
    }
}